﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InputExam.aspx.cs" Inherits="School_Manage_InputScore_InputExam" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>从当前考试录入</title>
<link href="../../../Common/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../Common/Js/jquery.js"></script>
<script type="text/javascript" src="../../../Common/Js/common.js"></script>
<script type="text/javascript" src="../../../Common/Js/msg.js"></script>

<script type="text/javascript">
var schoolExamId='',eduExamId,grade,classType;
//关闭修改局级考试的遮罩层
function CloseUpdateWindow()
{
    self.parent.CloseMask('popTable');
}    


function GetExamInfo()
{
    var value = event.srcElement.value;
    schoolExamId = value;
}

function Import()
{
   if(schoolExamId > 0)
   {
        eduExamId = document.getElementById('txtExamId').value;
        grade = document.getElementById('txtGrade').value;
        classType = document.getElementById('txtClassType').value;
        
//        if(eduExamId > && grade > 0 && classType != -1)
//        {
             PageMethods.Import(eduExamId,schoolExamId,grade,classType,function(succ){
                        if(succ == 0)
                        {
                            parent.showMassgeBox("提示","导入成功",1,null);
                            CloseUpdateWindow();
                        }
                        else
                        {
                             parent.showMassgeBox("提示","导入失败",1,null);
                        }
                },function(err){
                      parent.showMassgeBox("提示",err._message,1,null);
                });
 //       }
   }
   else
        parent.showMassgeBox("提示","请选择考试",1,null); 
}

</script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
   <div class="mainWarp" style="height: 88%; overflow: auto; border-top: #9be0f0 1px solid;padding-top:8px;">
            <div class="pageBody">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                 <ContentTemplate>
         <table id="updateExamTable"  style="width: 95%;border-style:none;border-bottom-color:#ffffff;" >
         <tr>
            <td style="width:30%;text-align:right;height:30px;" >考试：</td>
            <td style="width:70%;text-align: left;height:30px;;"><asp:Label ID="examName" runat="server"></asp:Label></td>
         </tr>
            <tr>
               <td style="width:30%;text-align:right;height:30px;;" >选择考试：</td>
               <td  style="width:70%;text-align: left;height:30px;;">
                    <select id="updateSelYear" onclick="GetExamInfo();" style="width:70%;">
                        <asp:Repeater ID="Repeater1" runat="server">
                            <ItemTemplate>
                                <option value="<%# Eval("RID") %>"><%# Eval("Name") %></option> 
                            </ItemTemplate>
                        </asp:Repeater>
                    </select>
               </td>
            </tr>
            <tr><td colspan="2" style="text-align:center;height:30px;;">
                    <ul class="butList">
                        <li><input type="button" value="确定" onclick="Import();" id="Button1"  class="commonBut" /> </li>
                        <li><input type="button" value="取消" onclick="CloseUpdateWindow();" class="commonBut"  /></li>
                    </ul>
                </td>
            </tr>
         </table>
         <div style=" display:none;" >
            <asp:Button ID="btnBind" runat="server" OnClick="btnBind_Click" />
            <asp:TextBox runat="server" ID="txtExamId" />
            <asp:TextBox runat="server" ID="txtGrade" />
            <asp:TextBox ID="txtExamName" runat="server"/>
            <asp:TextBox runat="server" ID="txtClassType" />
         </div>
         </ContentTemplate>
         </asp:UpdatePanel>
         </div>
    </div>
    </form>
</body>
</html>
